<div class="easyui-panel">
    <div class="panel-header">
        <h1>用户注册</h1>
    </div>
    <div class="panel-body">
        <div class="container">
            <form id="reg_form">
            <div class="row">
                <div class="col-md-10">
                    <label>用户名称</label>
                    <input class="easyui-textbox" name="username">
                </div>
                <div class="col-md-10">
                    <label>用户密码</label>
                    <input class="easyui-textbox" name="username">
                </div>
            </div>
            </form>
        </div>
    </div>
    <div class="panel-footer">
        <div class="row">
            <div class="col-xs-12 col-sm-11 col-md-11 text-right">
                <a id="reg_save" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
                <a id="reg_close" class="easyui-linkbutton" data-options="iconCls:'icon-back'">退出</a>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        $('#reg_save').on('click',function(e){
            $.messager.progress();
            $('#reg_form').form('submit',{
                url: '/saveuser',
                onSubmit: function(){
                    var isValid = $(this).form('validate');
                    if (!isValid){
                        $.messager.progress('close');	// 如果表单是无效的则隐藏进度条
                    }
                    return isValid;	// 返回false终止表单提交
                },
                success: function(data){
                    data = eval('(' + data + ')');
                    console.log(data)
                    $.messager.progress('close');	// 如果提交成功则隐藏进度条
                }
            })
        })
        $('#reg_close').on('click',function(e){
            $('#index_dlg').dialog('close')
        })
    })
</script>